import moment from 'moment';
// 命名规范：Arr普通枚举  field下拉字段枚举  Map表格字段枚举

// 表头筛选字段
const headerForm = {};
// 表格字段
const tableColumn = {
  // 表格列表
  eduTypeTableMap: [
    {
      prop: 'id',
      type: 'text',
      label: 'ID',
    },
    {
      prop: 'eduTypeName',
      type: 'text',
      label: '院校性质',
    },
    {
      prop: 'isDeleted',
      type: 'text',
      label: '是否删除',
      optionKey: 'DELETE_STATUS'
    },
    {
      prop: 'createTime',
      type: 'text',
      label: '创建时间',
    },
    {
      prop: 'updateTime',
      type: 'text',
      label: '更新时间',
    },
  ],
};
// 表单字段
const editForm = {
  // 筛选表单
  eduTypeFilterMap: [
    {
      prop: 'eduTypeName',
      type: 'input',
      label: '院校性质',
      clearable: true,
      width: 100,
      col: 0,
    },
    {
      prop: 'status',
      type: 'select',
      label: '状态',
      clearable: true,
      optionKey: 'COVERT_STATUS',
      width: 100,
      col: 0,
    },
    {
      prop: 'createTime',
      type: 'datePicker',
      label: '创建时间',
      startProp: 'createTimeStartTime',
      endProp: 'createTimeEndTime',
      dateType: 'datetimerange',
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      pickerOptions: {
        disabledDate: function (time) {
          return time.getTime() > moment().format('x');
        },
      },
      width: 100,
      col: 0,
      xs: 12,
      sm: 12,
      md: 8,
      lg: 8,
      xl: 6,
    },
    {
      prop: 'updateTime',
      type: 'datePicker',
      label: '更新时间',
      startProp: 'updateTimeStartTime',
      endProp: 'updateTimeEndTime',
      dateType: 'datetimerange',
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      pickerOptions: {
        disabledDate: function (time) {
          return time.getTime() > moment().format('x');
        },
      },
      width: 100,
      col: 0,
      xs: 12,
      sm: 12,
      md: 8,
      lg: 8,
      xl: 6,
    },
  ],
  // 新增/修改表单
  eduTypeFormMap: [
    {
      prop: 'eduTypeName',
      type: 'input',
      label: '院校性质',
      clearable: true,
      col: 24,
    },
    {
      prop: 'enCode',
      type: 'input',
      label: '院校性质代号',
      clearable: true,
      col: 24,
    },
    {
      prop: 'status',
      type: 'select',
      label: '状态',
      optionKey: 'COVERT_STATUS',
      clearable: true,
      col: 24,
    },
  ],
};
// 其他映射
const otherMap = {};
// 表单字段校验
const editRule = {
  eduTypeFormRule: {
    eduTypeName: [{ required: true, message: '院校性质不能为空', trigger: 'blur' }],
    enCode: [{ required: true, message: '代号不能为空', trigger: 'blur' }],
    status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
  },
};
export default {
  headerForm,
  tableColumn,
  editForm,
  otherMap,
  editRule,
};
